package com.bjtu.transactionclient.controller;

import com.bjtu.transactionclient.base.result.Result;
import com.bjtu.transactionclient.domain.RecordInfo;
import com.bjtu.transactionclient.domain.SendSqlData;
import com.bjtu.transactionclient.domain.User;
import com.bjtu.transactionclient.service.SyncService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/sync")
public class SyncController {

    @Autowired
    private SyncService syncService;

    @RequestMapping(value = "/sqlOperation", method = RequestMethod.POST)
    public List<Result> sendSqlMsg(@RequestBody List<SendSqlData> sendSqlDataList){
        List<Result> rs = syncService.sendSqlMsg(sendSqlDataList);
        return rs;
    }
    @RequestMapping(value = "/otherTeamUserInfo", method = RequestMethod.POST)
    public List<RecordInfo> otherTeamUserInfo(@RequestBody User curUser, @RequestParam("date") String date){
        return syncService.otherTeamUserInfo(curUser,date);
    }
}
